import sys
from PySide6.QtCore import Qt, QFile, QIODevice
from PySide6.QtWidgets import QApplication
from app.main_window import MainWindow as MainWindow

if __name__ == "__main__":
    app = QApplication(sys.argv)
    
    # 加载全局QSS样式表
    style_file = QFile("qss/style.qss")
    if style_file.open(QIODevice.ReadOnly | QIODevice.Text):
        style_sheet = style_file.readAll()
        app.setStyleSheet(str(style_sheet, encoding='utf-8'))
        style_file.close()
    
    window = MainWindow()
    window.show()
    
    sys.exit(app.exec())